package cn.test.yuecai.util;

import java.util.Random;

public class RandomNum {
	public static int randomNum(int bits){
		int randomNum = 0;
		Random random = new Random();
		if (bits > 0 ) {
			randomNum = random.nextInt(bits);
			return randomNum;
		}else {
			throw new IllegalArgumentException("bits must be postive");
		}
	}
}
